package net.jxvtc.web;

import java.util.ArrayList;
import java.util.List;

import net.jxvtc.datatable.Employees;

import com.opensymphony.xwork2.ActionSupport;

public class EmpAction extends ActionSupport{
	private int draw= 1;
	private int recordsTotal=57;
	private int recordsFiltered=57;
	private List<Employees> data;
	public int getDraw() {
		return draw;
	}
	public void setDraw(int draw) {
		this.draw = draw;
	}
	public int getRecordsTotal() {
		return recordsTotal;
	}
	public void setRecordsTotal(int recordsTotal) {
		this.recordsTotal = recordsTotal;
	}
	public int getRecordsFiltered() {
		return recordsFiltered;
	}
	public void setRecordsFiltered(int recordsFiltered) {
		this.recordsFiltered = recordsFiltered;
	}
	public List<Employees> getData() {
		return data;
	}
	public void setData(List<Employees> data) {
		this.data = data;
	}

@Override
	public String execute() throws Exception {
	Employees emp;
	data=new ArrayList<Employees>();
		for(int i=0;i<20;i++)
		{
			emp=new Employees();
			emp.setAge(20+i);
			emp.setName("emp"+i);
			emp.setOffice("office"+i);
			emp.setPosition("pos"+i);
			emp.setSalary(3000);
			emp.setStart_date("2015-12-11");
			data.add(emp);
		}
		setRecordsTotal(20);
		setRecordsFiltered(20);
		return SUCCESS;
	}
}
